﻿const { VueLoaderPlugin } = require('vue-loader')
const path = require("path");


module.exports = {
    mode: 'production',
    //mode: 'development',
    devtool: "source-map",
    entry:"./src/index.js",
    output: {
        clean: false,
        filename: "lucas-form.js",
        library: "LucasMyForm",
    },
    module: {
        rules: [
            {
                test: /\.tsx?$/,
                loader: 'ts-loader',
                options: {
                    appendTsSuffixTo: [/\.vue$/],
                },
                exclude: /node_modules/,
            },
            {
                test: /\.vue$/,
                loader: 'vue-loader'
            },
            {
                test: /\.js$/,
                loader: 'babel-loader',
                exclude: file => (
                    /node_modules/.test(file) &&
                    !/\.vue\.js/.test(file)
                )
            },
            {
                test: /\.css$/,
                use: [
                    'vue-style-loader',
                    'css-loader'
                ]
            },
            {
                test: /\.(png|jpg|jpeg|gif|eot|ttf|woff|woff2|svg|svgz)$/,
                loader: 'file-loader',
                options: {
                    name: "images/[name].[ext]"
                }
            }
        ]
    },
    plugins: [
        new VueLoaderPlugin(),
    ],
    externals: {
        'vue': 'Vue',
        'element-plus':'ElementPlus',
        'echarts': 'echarts'
    },
}